#!/bin/sh

CONFDIR=config

localln()
{
    \rm -rf ~/.vim
    ln -svf ${CONFDIR}/vim/vimrc                .vimrc
    ln -svf ${CONFDIR}/vim/vim                  .vim
    ln -svf ${CONFDIR}/bash/bashrc              .bashrc
    ln -svf ${CONFDIR}/bash/aliasrc             .aliasrc
    ln -svf ${CONFDIR}/bash/gitfunc             .gitfunc
    ln -svf ${CONFDIR}/git/gitconfig            .gitconfig
    ln -svf ${CONFDIR}/git/git-completion.bash  .git-completion.bash
    ln -svf ${CONFDIR}/bash/functionsrc         .functionsrc
    ln -svf ${CONFDIR}/bash/bash_profile        .bash_profile
    ln -svf ${CONFDIR}/bash/gopath              .gopath
    ln -svf ${CONFDIR}/bash/gofunc              .gofunc
}

userhomelocalln()
{
    cd
    localln
    cd -
}

# init vim plug-in
COMPRESSED=vim.tar
if [ ! -f vim/$COMPRESSED ]; then
    echo "error: not fount $COMPRESSED, can not init or inited."
    exit 1
fi

cd vim
sh uncompress
cd -

userhomelocalln

echo done.
